<template>
  <el-dialog title="用水量详情" :visible.sync="dialogVisible" width="60%">
    <!-- 表单 -->
    <el-form label-width="130px">
      <!-- 用水详细 -->
      <el-row>
        <el-col :span="6" v-for="(item,itemIndex) in listData" :key="item.name">
          <el-form-item :label="item.name">
            <el-input
              type="age"
              v-model.number="item.value"
              :disabled="item.active"
              @input="handleQuarter(itemIndex)"
            ></el-input>
          </el-form-item>
          <el-form-item :label="list.monthName" v-for="list in item.item" :key="list.monthName">
            <el-input
              type="age"
              v-model.number="list.monthValue"
              :disabled="list.active"
              @input="handleMonth(itemIndex)"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible = false">取 消</el-button>
    </span>
  </el-dialog>
</template>

<script>
import { catWanterById } from '@/api/other'
import { listDataVal } from '@/config/dataList'
export default {
  data() {
    return {
      dialogVisible: false,
      listData: listDataVal(),
    }
  },
  mounted() {},
  methods: {
    init(id, result = undefined) {
      this.dialogVisible = true
      if (id) {
        catWanterById({ id }).then((res) => {
          const { code, data, msg } = res
          if (code !== '0000') return this.$message.error(msg)
          this.dataInfoFun(data)
        })
      } else {
        this.dataInfoFun(result)
      }
    }
  }
}
</script>

<style>
</style>
